import React, { Component } from 'react';
import {Switch,Route,Redirect} from 'react-router';
import App from './app';
import Login from '../login/login';

class Index extends Component {
  constructor(props) {
    super(props);
  }
  
  getusetinfo=(data)=>{
    console.log(data)
  }

  render() { 
    return (
      <Switch>
        <Route path='/home' component={App}/>
        <Route exact path='/login' component={()=><Login getusetinfo={this.getusetinfo}/>}/>
        <Redirect to='/login' />
      </Switch>
    );
  }
}
 
export default Index;